//
//  OrderDetailNotifierCell.m
//  LuxuryGoods
//
//  Created by DCQ on 2018/5/29.
//  Copyright © 2018年 Future. All rights reserved.
//

#import "OrderDetailNotifierCell.h"
@interface OrderDetailNotifierCell ()
@property (weak, nonatomic) IBOutlet UIImageView *imgV;
@property (weak, nonatomic) IBOutlet UILabel *title;
@property (weak, nonatomic) IBOutlet UILabel *detail;
@property (weak, nonatomic) IBOutlet UIButton *btn;
@property (assign, nonatomic)  DetailNotifierStyle style;
@end
@implementation OrderDetailNotifierCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setupOrderDetail:(DetailNotifierStyle)style withLogisticsName:(NSString *)logisticsName withLogisticsNo:(NSString *)logisticsNo{
    NSString * imgName = @"";
    NSString * titleStr = @"";
    NSString * detailStr = @"";
    NSString * btnTitle = @"";
    if (style == DetailNotifierStyle_logistics ) {
        imgName = @"dingdan_wuliu";
        titleStr = [@"物流公司："stringByAppendingString: logisticsName];
        detailStr = [@"物流单号：" stringByAppendingString:logisticsNo];
        btnTitle = @"查看物流";
    } else if(style == DetailNotifierStyle_refund){
        imgName = @"dingdan_tuikuan" ;
        titleStr = @"退款成功";
        detailStr = @"退款金额已经原路返回到你您的账户里";
        btnTitle = @"退款详情";
        
    } else if(style == DetailNotifierStyle_refundAudit){
        imgName = @"dingdan_tuikuan" ;
        titleStr = @"退款审核中";
        detailStr = @"商家将会及时和您联系退款事宜";
        btnTitle = @"退款详情";
        
    }
    self.style = style;
    self.imgV.image = [UIImage imageNamed:imgName];
    self.title.text = titleStr;
    self.detail.text =  detailStr;
    [self.btn setTitle:btnTitle forState:UIControlStateNormal];
}
- (IBAction)btnAction:(id)sender {
    if (self.btnBlock) {
        self.btnBlock(self.style);
    }
}

@end
